package com.vanzo.talkie;

import com.vanzo.encryption.Encryption;
import com.vanzo.encryption.Pdt;

/**
 * Created by tisen on 2018/2/27.
 */

public class Follower {
    private byte[] gk;
    private byte[] kk;
    private int groupId;
    private int terminalId;
    private int totalTerminalSize;
    private int firstId;
    private int channelId;
    private int isLocked;
    private byte[] nfc;

    public Follower() {
    }

    public Follower(int terminalId) {
        this.terminalId = terminalId;
    }

    public Follower(byte[] gk, byte[] kk, int groupId, int terminalId, int totalTerminalSize, int firstId, int channelId, int isLocked) {
        this.gk = gk;
        this.kk = kk;
        this.groupId = groupId;
        this.terminalId = terminalId;
        this.totalTerminalSize = totalTerminalSize;
        this.firstId = firstId;
        this.channelId = channelId;
        this.isLocked = isLocked;
        this.nfc = Encryption.getNfc2(this);
    }

    public byte[] getNfc() {
        return nfc;
    }

    public Integer getLength() {
        return nfc.length;
    }

    public byte[] getGk() {
        return gk;
    }

    public void setGk(byte[] gk) {
        this.gk = gk;
    }

    public byte[] getKk() {
        return kk;
    }

    public void setKk(byte[] kk) {
        this.kk = kk;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public int getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(int terminalId) {
        this.terminalId = terminalId;
    }

    public int getTotalTerminalSize() {
        return totalTerminalSize;
    }

    public void setTotalTerminalSize(int totalTerminalSize) {
        this.totalTerminalSize = totalTerminalSize;
    }

    public int getFirstId() {
        return firstId;
    }

    public void setFirstId(int firstId) {
        this.firstId = firstId;
    }

    public int getChannelId() {
        return channelId;
    }

    public int getIsLocked() {
        return isLocked;
    }

    @Override
    public String toString() {
        return "Follower{" +
                "groupId=" + groupId +
                ", terminalId=" + terminalId +
                ", totalTerminalSize=" + totalTerminalSize +
                ", firstId=" + firstId +
                '}';
    }

    public static Follower crate(int terminalId) {
        return new Follower(terminalId);
    }
}
